//
//  ADCollectionViewCell.swift
//  手账
//
//  Created by zhuxiaoxiang on 2018/11/16.
//  Copyright © 2018年 zhuxiaoxiang. All rights reserved.
//

import UIKit
import SnapKit

class ADCollectionViewCell: UICollectionViewCell {
    
    lazy var adImageView: UIImageView = { () -> UIImageView in
       let imageView = UIImageView()
        imageView.layer.cornerRadius = 5
        imageView.layer.shadowOffset = CGSize(width: 0, height: 1)
        imageView.layer.shadowOpacity = 0.5
        imageView.layer.shadowColor = UIColor.gray.cgColor
        imageView.layer.shadowRadius = 5
       return imageView
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUpUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

extension ADCollectionViewCell {
    func setUpUI() {
        self.contentView.addSubview(self.adImageView)
        self.adImageView.snp.makeConstraints { (maker) in
            maker.top.bottom.equalTo(self.contentView)
            maker.left.equalTo(20)
            maker.right.equalTo(-20)
        }
    }
}
